/**
 * Created by hotchwong on 17/1/11.
 */

import send from './http'
export default {
  getKmUptoken (data) {
    let req = {
      data,
      action: 'app.km.cosGetKmUptoken'
    }
    return send.fetch(req, 'post')
  },
  queryCatalogList (data) {
    let flag = data.flag
    delete data.flag
    let req = {
      data,
      action: 'app.km.queryCatalogList'
    }
    return send.fetch(req, 'post', flag)
  },
  addCatalog (data) {
    let req = {
      data,
      action: 'app.km.addCatalog'
    }
    return send.fetch(req, 'post')
  },
  updateCatalog (data) {
    let req = {
      data,
      action: 'app.km.updateCatalog'
    }
    return send.fetch(req, 'post')
  },
  delCatalog (data) {
    let req = {
      data,
      action: 'app.km.delCatalog'
    }
    return send.fetch(req, 'post')
  },
  showCatalogEdit (data) {
    let req = {
      data,
      action: 'app.km.showCatalogEdit'
    }
    return send.fetch(req, 'post')
  },
  queryRecentList (data) {
    let flag = data.flag
    delete data.flag
    let req = {
      data,
      action: 'app.km.queryRecentList'
    }
    return send.fetch(req, 'post', flag)
  },
  queryItemList (data) {
    let req = {
      data,
      action: 'app.km.queryItemList'
    }
    return send.fetch(req, 'post', data.type === 'im')
  },
  uploadDoc (data) {
    let req = {
      data,
      action: 'app.km.uploadDoc'
    }
    return send.fetch(req, 'post')
  },
  saveItem (data) {
    let req = {
      data,
      action: 'app.km.saveItem'
    }
    return send.fetch(req, 'post')
  },
  showItemEdit (data) {
    let req = {
      data,
      action: 'app.km.showItemEdit'
    }
    return send.fetch(req, 'post')
  },
  updateItem (data) {
    let req = {
      data,
      action: 'app.km.updateItem'
    }
    return send.fetch(req, 'post')
  },
  delItem (data) {
    let req = {
      data,
      action: 'app.km.delItem'
    }
    return send.fetch(req, 'post')
  },
  batchDelItem (data) {
    let req = {
      data,
      action: 'app.km.delItems'
    }
    return send.fetch(req, 'post')
  },
  batchUpdateCid (data) {
    let req = {
      data,
      action: 'app.km.updateItemsCid'
    }
    return send.fetch(req, 'post')
  },
  batchUpdateValidityPeriod (data) {
    let req = {
      data,
      action: 'app.km.updateItemsValidityPeriod'
    }
    return send.fetch(req, 'post')
  },
  kmPlaceTop (data) {
    let req = {
      data,
      action: 'app.km.itemPlaceTop'
    }
    return send.fetch(req, 'post')
  },
  delAttach (data) {
    let req = {
      data,
      action: 'app.km.delAttach'
    }
    return send.fetch(req, 'post')
  },
  queryKmDic (data) {
    let req = {
      data,
      action: 'app.km.queryKmDic'
    }
    return send.fetch(req, 'post')
  },
  queryWholeKmDic (data) {
    let req = {
      data,
      action: 'app.km.queryWholeKmDic'
    }
    return send.fetch(req, 'post')
  },
  queryKmHotWords (data) {
    let req = {
      data,
      action: 'app.km.queryKmHotWords'
    }
    return send.fetch(req, 'post')
  },
  submitComments (data) {
    let req = {
      data,
      action: 'app.km.replyKmItem'
    }
    return send.fetch(req, 'post')
  },
  getComments (data) {
    let req = {
      data,
      action: 'app.km.getKmReplyById'
    }
    return send.fetch(req, 'post')
  },
  getKmLogs (data) {
    let req = {
      data,
      action: 'app.km.getKmLogs'
    }
    return send.fetch(req, 'post')
  },
  deleteTheComments (data) {
    let req = {
      data,
      action: 'app.km.deleteKmItemReply'
    }
    return send.fetch(req, 'post')
  },
  getXlsHeads (data) {
    let req = {
      data,
      action: 'app.km.getXlsHeads'
    }
    return send.fetch(req, 'post')
  },
  addKmExportTask (data) {
    let req = {
      data,
      action: 'app.km.addKmExportTask'
    }
    return send.fetch(req, 'post')
  },
  getKmExportList (data) {
    let req = {
      data,
      action: 'app.km.getKmExportList'
    }
    return send.fetch(req, 'post')
  },
  importKmItem (data) {
    let req = {
      data,
      action: 'app.km.importKmItem'
    }
    return send.fetch(req, 'post')
  },
  getKmImportList (data) {
    let req = {
      data,
      action: 'app.km.getKmImportList'
    }
    return send.fetch(req, 'post')
  },
  removeKmImport (data) {
    let req = {
      data,
      action: 'app.km.removeKmImport'
    }
    return send.fetch(req, 'post')
  }
}
